<?php

declare(strict_types=1);

namespace App\Model\Authentication;

use App\Model\Model;
use Hyperf\Database\Model\Relations\BelongsToMany;

class Admin extends Model
{
    protected ?string $table = 'admin';

    protected array $fillable = ['username', 'mobile', 'realname', 'email', 'password', 'is_super'];

    public function roles(): BelongsToMany
    {
        return $this->belongsToMany(Role::class, 'admin_role', 'admin_id', 'role_id');
    }
}
